{% extends "admin_base.html" %}

{% block title %}File - Admin - Blog{% endblock %}

{% block page_content %}
<div class="pure-g">
  <div class="pure-u">
    <table class="pure-table pure-table-bordered">
        <thead>
            <tr>
                <td>#</td>
                <td>Name</td>
                <td>Title</td>
                <td>Type</td>
                <td>Action</td>
            </tr>
        </thead>
        <tbody>
           {% for f in file_list %}
            <tr>
                <td>{{ loop.index }}</td>
                <td>{{ f.file_name }}</td>
                <td>{{ f.title }}</td>
                <td>{{ f.content_type }}</td>
                <td>
                    <a href="{{ uri_for('serv', file_id=f.key().id(), file_name=f.file_name) }}">Download</a>
                    <a href="{{ uri_for('admin-file-delete', file_id=f.key().id()) }}">Delete</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
  </div>
</div>
{#
<div class="pure-g">
  <div class="pure-u">
    <form id="file-upload-form" action="{{ upload_url }}" method="POST" enctype="multipart/form-data" class="pure-form-stacked">
        <fieldset>
            <legend>Upload File</legend>
            <label for="inp_file">File: </label>
            <input type="file" id="inp_file" name="file" />
            <label for="inp_title">Title: </label>
            <input type="text" id="inp_title" name="file_title" value="" placeholer="File Title" />
            <button type="submit" class="pure-button notice">Save</button>
        </fieldset>
    </form>
  </div>
</div>
#}
{% endblock %}
